<script language="javascript">
	
 function wopen(url, name, w, h){
	  w += 32;
	  h += 96;
	  wleft = (screen.width - w) / 2;
	  wtop = (screen.height - h) / 2;
	  
	  if (wleft < 0) {
		w = screen.width;
		wleft = 0;
	  }
	  if (wtop < 0) {
		h = screen.height;
		wtop = 0;
	  }
	  var win = window.open(url,
		name,
		'width=' + w + ', height=' + h + ', ' +
		'left=' + wleft + ', top=' + wtop + ', ' +
		'location=no, menubar=no, ' +
		'status=no, toolbar=no, scrollbars=yes, resizable=no');
	  // Just in case width and height are ignored
	  win.resizeTo(w, h);
	  // Just in case left and top are ignored
	  win.moveTo(wleft, wtop);
	  win.focus();
}
function printTL(namhoc,hocki,makhoa){
	
	wopen('intkthcuadv.php?namhoc='+namhoc+'&hocki='+hocki+'&makhoa='+makhoa+'','780','580');
}  
</script>
<?php
     
    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         $namhoc = $_POST['cbonamhoc'];
            $hocki = $_POST['cbohocki'];
			$makhoa = $_POST['cbokhoa'];
			$mabm = $_POST['cbobomon'];
            $maquyen = $_SESSION['nmaquyen'];
        if (isset($_POST['btnxem'])){
           
            $makhoa = " ";
            if ($_SESSION['nmaquyen'] == 'AD')
			{
                $makhoa= $_POST['cbokhoa'];
            }
            else{ 
				 $db->setQuery("select makhoa from CanBoGiangDay a, BoMon b where maso='".$_SESSION['nmaso']."' and a.mabm= b.mabm");
				$result = $db->fetchAll();
				$rows = mysql_fetch_array($result);
				$makhoa = $rows['makhoa'];
				
            }
          
           
          
            $db->setQuery("select tenkhoa  from Khoa  where makhoa='".$makhoa."' ");
            $result = $db->fetchAll();
			
            $rows = mysql_fetch_array($result);
            $tenkhoa = $rows['tenkhoa'];
			
			require('Views/Xemtkthcuadv.php');
            require('Hienthitkthcuadv.php');
        }
		else  require('Views/Xemtkthcuadv.php');
        
        
    }
    else
	{
        if ($_GET['option']=='xemtkthdonvi'){
            require('Views/Xemtkthcuadv.php');
        }
        
    }
  
                                
  
?>
